/**
 * 
 */
package fr.ants.controller.command;

import fr.ants.controller.clock.Clock;

/**
 * Command to stop the simulation.
 */
public class StopCommand implements Command {

	/**
	 * Clock.
	 */
	private final Clock clock;

	/**
	 * Build.
	 * 
	 * @param clock
	 *            clock
	 */
	public StopCommand(final Clock clock) {
		this.clock = clock;
	}

	@Override
	public void execute() {
		clock.getSimulator().getGrid().reset();
		clock.stop();
	}
}